package com.yzkj.siot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.yzkj.siot.base.BaseController;
import com.yzkj.siot.util.TencentCOSHelper;

@RestController
@RequestMapping("/test")
public class TestController extends BaseController {
	
	@Autowired
	TencentCOSHelper tencentCOSHelper;
	
	@GetMapping("test1")
    public Boolean test1() {
    	
        return Boolean.TRUE;
    }
	
    @PostMapping("test")
    public Object test(@RequestParam MultipartFile file) {
    	System.out.println(tencentCOSHelper.uploadFile("dataExport", file));
    	
        return Boolean.TRUE;
    }
}
